@inherits FunnelWeb.Web.App_Code.HelperPage
@using System.Web.Mvc
@using System.Web.Mvc.Html
@using FunnelWeb.Model
@using FunnelWeb.Web.Application.Extensions

@helper Render(IEnumerable<Entry> entries)
{
  <div class="post-list">
    @foreach (var entry in entries)
    {
    <div class='post-line @String.Join(" ", Html.CssKeywordsFor(entry))'>
      <div class='revised'>
        <span class='month'>@entry.Published.ToLocalTime().ToString("MMM d")</span> 
        <span class='year'>@entry.Published.ToLocalTime().ToString("yyyy")</span>
      </div>
      <div class='comments'>
        <a href='@Url.Action("Page", "Wiki", new { page = entry.Name })#comments'>
          <span class='comment-count'>@entry.CommentCount</span>
          <span>comment@(entry.CommentCount == 1 ? "" : "s")</span>
        </a>
      </div>
      <div class='summary'>
        <h2>
          @Html.ActionLink(entry.Title, "Page", "Wiki", new { page = entry.Name }, null)
        </h2>
        @if (!string.IsNullOrEmpty(entry.MetaDescription))
        {
        <p>@entry.MetaDescription</p>
        }
        @TagList.Render(entry.Tags)
      </div>
    </div>
    }
  </div>
}


